import { pget, postFileByFormData, ppostJson } from '@/utils/req'
import { modalApi } from '@/utils/modalReq'

/** 获取盘点计划列表 */
export function getPlanList(query?: any) {
	return pget(`${modalApi.carMessage}/stocktake/plan/page`, query)
}
/** 获取盘点列表 */
export function getStocktakeList(query?: any) {
	return pget(`${modalApi.carMessage}/common/stocktake/list`, query)
}

/** 新增盘点计划 */
export function addStocktake(data: any) {
	return ppostJson(`${modalApi.carMessage}/stocktake/plan/add`, data)
}

/** 修改盘点计划 */
export function editStocktake(data: any) {
	return ppostJson(`${modalApi.carMessage}/stocktake/plan/update`, data)
}

/** 查看盘点计划详情 */
export function stocktakeInfo(query: any) {
	return pget(`${modalApi.carMessage}/stocktake/plan/info`, query)
}

/** 获取盘点计划-任务跟进信息列表 */
export function getStocktakeTaskList(query?: any) {
	return pget(`${modalApi.carMessage}/stocktake/plan/task/list`, query)
}

/** 任务重置 */
export function stocktakeTaskReset(data: any) {
	return ppostJson(`${modalApi.carMessage}/stocktake/plan/task/reset`, data)
}
/** 任务提醒 */
export function stocktakeTaskTip(data: any) {
	return ppostJson(`${modalApi.carMessage}/stocktake/plan/task/tip`, data)
}
/** 盘点清单 */
export function stocktakeDataList(data: any) {
	return ppostJson(`${modalApi.carMessage}/stocktake-data-list/page`, data)
}
/** 盘点计划审核 */
export function inventoryPlanAuditFlow(data: any) {
	return ppostJson(`${modalApi.carMessage}/stocktake/plan/auditFlow`, data)
}
/** 获取盘点清单查询条件列表 */
export function getStocktakeDataList(query?: any) {
	return pget(
		`${modalApi.carMessage}/common/stocktake-data-list/selectFields`,
		query,
	)
}
/** 获取导入失败列表 */
export function getStockatekDataListPage(query: any) {
	return pget(
		`${modalApi.carMessage}/assetsaccidentdataprocessing/stockatekDataListPage`, query
	)
}
/** 导入抽盘结论 */
export function inventoryPlanImport(data: any) {
	return postFileByFormData(
		`${modalApi.carMessage}/stocktake-data-list/import`,
		data,
	)
}

/** 通用-查询盘点表信息 */
export function stocktakeInfos(query: any) {
	return pget(`${modalApi.carMessage}/common/stocktake/info`, query)
}
/** 通用-查询盘点表信息 */
export function stocktakeDefinitionList(query: any) {
	return pget(
		`${modalApi.carMessage}/common/stocktake/definition-list`,
		query,
	)
}
